//
//  TimeTableViewCell.m
//  HuaLiWeiChuangApp
//
//  Created by 李文强 on 2018/10/24.
//  Copyright © 2018年 李文强. All rights reserved.
//

#import "TimeTableViewCell.h"

@implementation TimeTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initView];
    }
    return self;
}
- (UILabel *)todayLabel{
    if (!_todayLabel) {
        UILabel *label = [[UILabel alloc]init];
        label.text = @"时间";
        label.textColor = [UIColor darkGrayColor];
        label.font = [UIFont systemFontOfSize:15];
        _todayLabel = label;
    }
    return _todayLabel;
}
- (UILabel *)titleLabel{
    if (!_titleLabel) {
        UILabel *label = [[UILabel alloc]init];
        label.text = @"标题";
        label.textAlignment = 0;
        label.textColor = [UIColor darkGrayColor];
        label.font = [UIFont systemFontOfSize:17];
        _titleLabel = label;
    }
    return _titleLabel;
}
- (UILabel *)rightLabel{
    if (!_rightLabel) {
        UILabel *label = [[UILabel alloc]init];
        label.text = @"3/4";
        label.textColor = [UIColor darkGrayColor];
        [label setFont:[UIFont fontWithName:@"Helvetica-Bold" size:15]];
        _rightLabel = label;
    }
    return _rightLabel;
}
- (UIView *)lineView{
    if (!_lineView) {
        UIView *view = [[UIView alloc]init];
        view.backgroundColor = TABBARCOLOR;
        _lineView = view;
    }
    return _lineView;
}
- (void)initView{
    self.backgroundColor = [UIColor clearColor];
    [self addSubview:self.lineView];
    [self addSubview:self.titleLabel];
    [self addSubview:self.rightLabel];
    [self addSubview:self.todayLabel];
    [_lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@10);
        make.width.equalTo(@3);
        make.top.equalTo(@10);
        make.height.equalTo(@20);
    }];
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.lineView.mas_right).offset(10);
        make.right.equalTo(@0).offset(-60);
        make.centerY.equalTo(self.lineView.mas_centerY);
        make.height.equalTo(@20);
    }];
    [_rightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(@0).offset(-10);
        make.centerY.equalTo(self.mas_centerY);
        make.height.equalTo(@20);
        make.width.equalTo(@40);
    }];
    [_todayLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@10);
        make.right.equalTo(@0).offset(-10);
        make.top.equalTo(self.titleLabel.mas_bottom).offset(10);
        make.height.equalTo(@20);
    }];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
